package  
org.puremvc.as3.fi.test.command
{
	import org.puremvc.as3.fi.test.PureMVCTestBase;
	import org.puremvc.as3.multicore.patterns.observer.Notification;

	/**
	 * @author a.fell
	 */
	public class CommandTest extends PureMVCTestBase 
	{
		private const NOTE_NAME : String = "testNote";
		
		public function CommandTest()
		{
			super(  );
		}
		
		public function testClassRegistration() : void
		{
			registerCommand();
			
			assertTrue( facade.hasCommand( NOTE_NAME ) );
		}
		
		protected function registerCommand() : void
		{
			var noteName : String = NOTE_NAME;
			var commandClassRef : Class = TestCommand;
			facade.registerCommand(noteName, commandClassRef);
		}
		
		public function testCommandExecution() : void
		{
			registerCommand();
			
			var notification : Notification = new Notification( NOTE_NAME , false );
			
			facade.notifyObservers(notification);
			
			assertTrue( notification.getBody() );
		}
	}
}
